use std::vec;

pub fn new_count_distinct(input_str: &str) -> usize {
    count_unique_elements_bitmap(input_str, 100000)
}


pub fn count_unique_elements_bitmap(s: &str, max_value: usize) -> usize{
    let mut bitmap: Vec<bool> = vec![false; max_value + 1];
    for element in s.split(',')  {
        if let Ok(num) = element.parse::<usize>(){
            bitmap[num] = true;
        }
    }

    bitmap.iter().filter(|&&x| x).count()
}
